package com.basic.library.binding.viewadapter.materialButton;


import androidx.core.content.ContextCompat;
import androidx.databinding.BindingAdapter;

import com.google.android.material.button.MaterialButton;

/**
 * Created by goldze on 2017/6/16.
 */

public class ViewAdapter {
    /**
     * EditText重新获取焦点的事件绑定
     */
    @BindingAdapter(value = {"icon"}, requireAll = false)
    public static void setIcon(MaterialButton button, final int icon) {
        button.setIcon(ContextCompat.getDrawable(button.getContext(), icon));
    }
}
